package com.taomeng.dao;

import com.taomeng.entity.LeaveApplication;
import com.taomeng.entity.LeaveApplicationDetail;
import com.taomeng.entity.LeaveApplicationInfo;
import com.taomeng.entity.PageBean;

import java.util.List;
import java.util.Map;


public interface LeaveDao {
    /**
     * 插入请假信息
     * @param leaveApplication 请假信息
     * @return
     */
    boolean add(LeaveApplication leaveApplication);

    /**
     * 根据分页信息查询请假信息
     * @param page  页码
     * @param limit 每页查几个
     * @param status   模糊查询关键字
     * @return  请假信息的map集合
     */
    PageBean<LeaveApplicationInfo> findAllByPage(int page, int limit, String status,Long departmentId,Long userId);
    /**
     * 根据id获取审批状态
     * @param id
     * @return
     */
    Integer getStatusById(int id);

    boolean updateStatus(int id, int status);

    /**
     * 请假详情
     * @param applicationId
     * @param teacherId
     * @param result
     * @param opinion
     */
    void addDetails(int applicationId, long teacherId,int status, int result, String opinion);

    List<LeaveApplicationDetail> findDetailByApplicationId(Integer applicationId);

    List<LeaveApplication> findApplicationByStudentId(Integer id);

    List<LeaveApplication> findBacklogApplication(Integer id);

    Map<String, Object> findApplicationInfoById(int id);

    boolean studentBack(Integer applicationId);
}
